<?php


class NewsModel
{
    public $ormData = null;

    public function __construct($activeRecorder)
    {
        $this->ormData = $activeRecorder;
    }

    function commit(...$commands){
        foreach ($commands as $command){
            if (is_subclass_of($command,'ICommand')){
                $command->isValid() && $command->exec($this->ormData);
            }
        }
    }
}